<template>
    <div>
        <el-dialog :visible.sync="visible" title="导出预览" width="1000px" @close="clearStatus">
            <el-table ref="previewTable" :data="exportData" height="550">
                <template v-for="item in exportColumn">
                    <el-table-column :prop="item.prop" :width="item.width !=null ? item.width : '' " :label="item.label" :show-overflow-tooltip="item.showOverflowTooltip!=null ? item.showOverflowTooltip : false"/>
                </template>
            </el-table>
            <template slot="footer">
                <el-button @click="clearStatus">关闭</el-button>
                <el-button type="primary" @click="exportClick">导出</el-button>
            </template>
        </el-dialog>
    </div>
</template>
<script>
  export default {
    props: ['exportData', 'exportColumn'],
    data() {
      return {
        visible: false //导出预览对话框
      };
    },
    mounted() {
      //console.log('visible', this.visible);
    },
    methods: {
      exportClick() {
        this.$emit('exprotClick');
      },
      initStatus(visible) {
        this.visible = visible;
        this.fileList = [];
      },
      clearStatus() {
        this.visible = false;
        this.fileList = [];
      }
    }
  };
</script>
<style scoped>
</style>
